package com.itgaoshu.mapper;


import com.itgaoshu.bean.Departments;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * 科室中心
 * 自动以Mapper接口需要继承自tk.mybatis.mapper.common.Mapper<T>接口
 */
public interface DepartmentsMapper {
    //查询所有科室
    @Select("select * from departments")
    public List<Departments> selectAllDepartments();
    //添加科室
    @Insert("insert into departments(department)values(#{department})")
    public int addDepartments(Departments departments);
    //模糊查询
    //select a.* from Tadvertisment a where a.title like concat(concat('%',?),'%')
    @Select("select * from departments where department like concat('%',concat(#{department},'%'))")
    public List<Departments> selectDepartments(Departments departments);
}